import http from "@/utils/http";

/** 文档知识点 */
// 添加文档知识点分类
export async function setFileCategory(data) {
    return http.post("/docCategory/addDocCategory", data)
}

// 编辑文档知识点分类
export async function editFileCategory(data) {
    return http.post("/docCategory/editDocCategory", data)
}

// 删除文档知识点分类
export async function delFileCategory(params) {
    return http.get("/docCategory/deleteDocCategory", params)
}

// 获取文档知识点分类树
export async function getFileCategoryTree(params) {
    return http.get("/docCategory/getDocCategoryTree", params)
}

// 移动文档知识点分类
export async function setUpOrDownFileCategory(params) {
    return http.get("/docCategory/upOrDownDocCategory", params)
}

// 上传文档
export async function uploadFile(data) {
    return http.postFormData("/doc/uploadDoc", data)
}

// 取消上传
export async function cancelUpload(data) {
    return http.post("/doc/cancelUpload", data)
}

// 新增Markdown文档
export async function addFile(data) {
    return http.post("/doc/addDoc", data)
}

// 编辑Markdown文档
export async function editFile(data) {
    return http.post("/doc/editDoc", data)
}

//新增附件文档
export async function docAddAttachDoc(data) {
    return http.post("/doc/addAttachDoc", data)
}

//编辑附件文档
export async function docEditAttachDoc(data) {
    return http.post("/doc/editAttachDoc", data)
}

// 上传附件
export async function docUploadAttach(data) {
    return http.uploadFile('/doc/uploadAttach', data)
}

// 停/启用文档
export async function enabledFile(data) {
    return http.post("/doc/enabled", data)
}

// 删除文档
export async function delFile(params) {
    return http.get("/doc/deleteDoc", params)
}

// 分享文档知识点
export async function shareFile(data) {
    return http.post("/robot/categoryConfig/doc/edit", data)
}

// 搜索文档信息
export async function searchFile(data) {
    return http.post("/doc/searchDoc", data)
}

// 获取文档信息
export async function getFileInfo(data) {
    return http.get("/doc/getDocById", data)
}

// 预览文档
export async function getFileView(data) {
    return http.get("/doc/previewDoc", data)
}

// 发布文档
export async function getRepostFile(data) {
    return http.get("/doc/repost", data)
}

// 取消发布文档
export async function getCancelPostFile(data) {
    return http.get("/doc/cancelPost", data)
}

// 获取知识库信息
export async function getRootCategoryInfo(data) {
    return http.get("/rootCategory/getRootCategoryInfoById", data)
}

// [模板市场]获取文档知识点分类
export async function getDocCategoryTree(params) {
    return http.get("/knowledge/systemTemplate/getDocCategoryTree", params)
}

// [模板市场]获取文档知识点列表
export async function knowledgeListFile(data) {
    return http.get("/knowledge/systemTemplate/listDoc", data)
}

// [模板市场]导入文档知识点
export async function knowledgeImportFile(data) {
    return http.post("/knowledge/systemTemplate/importDoc", data)
}

//移动文档知识点文磊
export async function docMoveCategory(data) {
  return http.post("/doc/move", data)
}

//批量同步文档知识点
export async function docBatchAsync(data) {
  return http.post("/doc/batchSync", data)
}

//文档库列表
export async function docLibraryList(data) {
  return http.get("/docLibrary/list", data)
}
//文档库新增
export async function docLibraryAdd(data) {
  return http.post("/docLibrary/add", data)
}
//文档库详情
export async function docLibraryInfo(data) {
  return http.get("/docLibrary/info", data)
}
//文档库编辑
export async function docLibraryUpdate(data) {
  return http.post("/docLibrary/edit", data)
}
//文档库删除
export async function docLibraryDelete(data) {
  return http.get("/docLibrary/delete", data)
}

//文档库-分享
export async function docLibraryListShare(data) {
  return http.get("/docLibrary/listShare", data)
}
export async function docLibraryAppShare(data) {
  return http.post("/robot/categoryConfig/doc/edit", data)
}
export async function docLibraryCategoryShare(data) {
  return http.get("/robot/categoryConfig/doc/info", data)
}

//文档库
export async function docLibraryAuth(data) {
  return http.get("/docLibrary/authority", data)
}

//批量删除文档
export async function docBatchDelete(data) {
  return http.post("/doc/batchDelete", data)
}

//admin
//文档库列表
export async function docLibraryListAdmin(data) {
  return http.get("/docLibrary/getSharedList", data)
}

export async function sharedTenantsList(data) {
  return http.get("/docLibrary/getSharedTenants", data)
}

export async function sharedTenantsAdd(data) {
  return http.post("/docLibrary/addShare", data)
}

export async function sharedTenantsDelete(data) {
  return http.post("/docLibrary/removeShare", data)
}

export async function docListTenByCategoryId(data) {
  return http.get("/doc/getDocListByCategory", data)
}

//异步查询文档库分类树
export async function docCategoryListById(data) {
  return http.get("/docCategory/getCategoryList", data)
}

export async function docTagListByPage(data) {
    return http.post("/docLibraryTag/getDocLibraryTagByPage", data)
}

export async function deleteDocTag(data) {
    return http.get("/docLibraryTag/deleteDocLibraryTag?id="+data)
}

export async function editDocTag(data) {
    return http.post("/docLibraryTag/editDocLibraryTag", data)
}

export async function addDocTag(data) {
    return http.post("/docLibraryTag/addDocLibraryTag", data)
}

export async function infoDocTag(data) {
    return http.post("/docLibraryTag/getDocLibraryTagInfo", data)
}

export async function selectDcTagList() {
    return http.get("/docLibraryTag/selectList")
}